#! coding: utf-8
from django.db import models

from UserManage.models import User


class BlogList(models.Model):
    GRADE_CHOICES = (
        ('H', u'优秀'),
        ('M', u'良好'),
        ('L', u'合格'),
        ('D', u'需要努力'),
    )
    author = models.ForeignKey(User)
    url = models.URLField(unique=True, verbose_name=u"博客URL")
    grade = models.CharField(max_length=20, null=True, choices=GRADE_CHOICES, verbose_name=u"评分")
    comment = models.TextField(null=True, verbose_name=u'评论')

    def __unicode__(self):
        return self.url

